/**
 * 询价.COM v1.0.0
 * http://xun-jia.com/
 *
 * Copyright (c) 2009 
 * 四川漾天空网络科技有限公司
 * 成都市天府软件园A3栋2楼
 *
 */
package com.xunjia.action;

import com.opensymphony.xwork2.Action;

/**
 * @author Mark
 * 
 * @Email Mark_yang@xun-jia.com
 * 
 * @Date 2009-4-10 上午10:36:08
 * 
 */
public class ChangePasswordAction extends XunJiaActionSupport {

	private static final long serialVersionUID = -7977252647382413077L;
	// 舊密碼
	private String oldpass;
	// 新密碼
	private String newpass;
	// 再次錄入新密碼
	private String newpassagain;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Override
	public String execute() throws Exception {
		/*// 獲取當前登陸用戶的密碼
		String pass = "";
		if (user instanceof ManagerInfo) {
			ManagerInfo loginUser = (ManagerInfo) user;
			pass = loginUser.getPassword();
		} else if (user instanceof GeneralUserInfo) {
			GeneralUserInfo loginUser = (GeneralUserInfo) user;
			pass = loginUser.getPassword();
		}
		// 如果輸入的密碼與當前密碼不符,返回
		if (!oldpass.equals(pass)) {
			addFieldError("oldpass", getText("change.old.failure"));
			return Action.INPUT;
		}
		// 如果兩次輸入的密碼不相符,返回
		if (!newpass.equals(newpassagain)) {
			addFieldError("newpassagain", getText("change.pass.diff.error"));
			return Action.INPUT;
		}*/
		// 執行修改密碼操作
		return Action.SUCCESS;
	}

	/**
	 * @return the oldpass
	 */
	public String getOldpass() {
		return oldpass;
	}

	/**
	 * @param oldpass
	 *            the oldpass to set
	 */
	public void setOldpass(String oldpass) {
		this.oldpass = oldpass;
	}

	/**
	 * @return the newpass
	 */
	public String getNewpass() {
		return newpass;
	}

	/**
	 * @param newpass
	 *            the newpass to set
	 */
	public void setNewpass(String newpass) {
		this.newpass = newpass;
	}

	/**
	 * @return the newpassagain
	 */
	public String getNewpassagain() {
		return newpassagain;
	}

	/**
	 * @param newpassagain
	 *            the newpassagain to set
	 */
	public void setNewpassagain(String newpassagain) {
		this.newpassagain = newpassagain;
	}
}
